.products-container {
  min-height: 100vh;
  background-color: #f5f5f5;
  padding-bottom: 40rpx;
  display: flex;
  flex-direction: column;
}

/* 主内容包装器 */
.main-content-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* 固定头部区域 */
.fixed-header {
  position: fixed;
  /* top值通过内联样式动态设置，确保从导航栏底部开始 */
  left: 0;
  right: 0;
  z-index: 99; /* 低于导航栏的z-index */
  background-color: #f5f5f5;
  padding: 20rpx;
  padding-bottom: 10rpx;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}

/* 确保导航栏固定在最上层 */
.products-nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: white;
}

.products-nav-bar .weui-navigation-bar__inner {
  position: relative;
  z-index: 1000;
  background-color: white;
}

/* 占位元素，用于为固定头部留出空间 */
.header-placeholder {
  flex-shrink: 0;
  /* 高度通过内联样式动态设置 */
}

/* 登录提示 */
.login-prompt {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60rpx;
  
  .login-card {
    background: white;
    border-radius: 20rpx;
    padding: 80rpx 60rpx;
    text-align: center;
    box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500rpx;
    
    .login-icon {
      width: 120rpx;
      height: 120rpx;
      margin-bottom: 40rpx;
      opacity: 0.6;
    }
    
    .login-title {
      display: block;
      font-size: 36rpx;
      font-weight: bold;
      color: #333;
      margin-bottom: 20rpx;
    }
    
    .login-desc {
      display: block;
      font-size: 28rpx;
      color: #999;
      margin-bottom: 60rpx;
    }
    
    .login-btn {
      background: #5cb85c;
      color: white;
      border-radius: 50rpx;
      font-size: 32rpx;
      padding: 24rpx 80rpx;
      border: none;
      
      &::after {
        border: none;
      }
    }
  }
}

/* 主要内容 */
.main-content {
  /* padding 已在 fixed-header 中设置 */
}

/* 筛选区域 */
.filter-section {
  background: white;
  border-radius: 16rpx;
  padding: 20rpx;
  margin-bottom: 20rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  
  // 状态标签 - 横向滚动
  .status-tabs {
    margin-bottom: 20rpx;
    
    .tabs-scroll {
      white-space: nowrap;
      
      &::-webkit-scrollbar {
        display: none;
      }
    }
    
    .status-tab {
      display: inline-block;
      padding: 16rpx 32rpx;
      margin-right: 20rpx;
      font-size: 28rpx;
      color: #666;
      background: #f8f9fa;
      border-radius: 20rpx;
      border: 2rpx solid transparent;
      transition: all 0.2s;
      
      &.active {
        background: #5cb85c;
        color: white;
        font-weight: 500;
        border-color: #5cb85c;
      }
      
      &:last-child {
        margin-right: 0;
      }
    }
  }
  
  .search-bar {
    .search-input-wrapper {
      display: flex;
      align-items: center;
      background: #f8f9fa;
      border-radius: 25rpx;
      padding: 15rpx 25rpx;
      border: 2rpx solid transparent;
      
      &:focus-within {
        border-color: #5cb85c;
        background: white;
      }
      
      .search-icon {
        width: 32rpx;
        height: 32rpx;
        margin-right: 15rpx;
        opacity: 0.5;
      }
      
      .search-input {
        flex: 1;
        font-size: 28rpx;
        background: transparent;
      }
      
      .search-clear {
        font-size: 36rpx;
        color: #999;
        padding: 5rpx;
        line-height: 1;
      }
    }
  }
}

/* 操作栏 */
.action-bar {
  background: white;
  border-radius: 16rpx;
  padding: 20rpx 30rpx;
  margin-bottom: 20rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  
  .batch-actions {
    height: 160rpx;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    padding-bottom: 20rpx;
    border-bottom: 1rpx solid #f0f0f0;
    box-sizing: border-box;
    
    .batch-header {
      height: 48rpx;
      display: flex;
      align-items: center;
      margin-bottom: 20rpx;
      flex-shrink: 0;
      
      .selected-text {
        font-size: 28rpx;
        color: #5cb85c;
        font-weight: 500;
        line-height: 48rpx;
      }
    }
    
    .batch-buttons {
      height: 72rpx;
      display: flex;
      gap: 15rpx;
      width: 100%;
      flex-shrink: 0;
      
      .batch-btn {
        flex: 1;
        height: 100%;
        padding: 0 16rpx;
        font-size: 26rpx;
        line-height: 72rpx;
        border-radius: 20rpx;
        border: 1rpx solid #5cb85c;
        color: #5cb85c;
        background: white;
        white-space: nowrap;
        text-align: center;
        box-sizing: border-box;
        
        &::after {
          border: none;
        }
        
        &:disabled {
          color: #bbb;
          border-color: #ddd;
        }
      }
    }
  }
  
  .normal-actions {
    display: flex;
    justify-content: center;
    padding-top: 20rpx;
    
    .add-product-btn {
      background: #5cb85c;
      color: white;
      border-radius: 25rpx;
      font-size: 30rpx;
      padding: 20rpx 40rpx;
      border: none;
      
      &::after {
        border: none;
      }
    }
  }
}

/* 商品列表 */
.product-list {
  flex: 1;
  height: 0;
  padding: 0 20rpx;
}

.product-card {
  background: white;
  border-radius: 16rpx;
  margin-bottom: 20rpx;
  padding: 30rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  position: relative;
  
  &.first-product {
    margin-top: 0;
    padding-top: 10rpx;
  }

  .product-checkbox {
    position: absolute;
    top: 20rpx;
    left: 20rpx;
    z-index: 2;
    width: 48rpx;
    height: 48rpx;
    border-radius: 50%;
    border: 3rpx solid #d1d5db;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    
    &.checked {
      border-color: #10b981;
    }
    
    .checkmark {
      color: #10b981;
      font-size: 32rpx;
      font-weight: bold;
      line-height: 1;
      animation: checkAnim 0.2s ease-in-out;
    }
  }

  @keyframes checkAnim {
    0% {
      transform: scale(0);
    }
    50% {
      transform: scale(1.2);
    }
    100% {
      transform: scale(1);
    }
  }
  
  .product-main {
    display: flex;
    margin-left: 60rpx;
    
    .product-image {
      width: 160rpx;
      height: 160rpx;
      border-radius: 12rpx;
      margin-right: 20rpx;
      background: #f8f9fa;
    }
    
    .product-info {
      flex: 1;
      
      .product-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 10rpx;
        
        .product-name {
          font-size: 32rpx;
          font-weight: 500;
          color: #333;
          flex: 1;
          line-height: 1.3;
          margin-right: 15rpx;
        }
        
        .product-tags {
          display: flex;
          gap: 8rpx;
          
          .tag {
            font-size: 20rpx;
            padding: 4rpx 12rpx;
            border-radius: 10rpx;
            
            &.hot {
              background: #ff4757;
              color: white;
            }
            
            &.new {
              background: #5cb85c;
              color: white;
            }
          }
        }
      }
      
      .product-desc {
        font-size: 26rpx;
        color: #999;
        margin-bottom: 12rpx;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
      }
      
      .product-specs {
        display: flex;
        flex-wrap: wrap;
        gap: 8rpx;
        margin-bottom: 12rpx;
        
        .spec-tag {
          font-size: 22rpx;
          padding: 6rpx 16rpx;
          background: #f0f7ff;
          color: #5cb85c;
          border-radius: 12rpx;
          border: 1rpx solid #e0f0ff;
        }
      }
      
      .product-price {
        margin-bottom: 12rpx;
        
        .current-price {
          font-size: 36rpx;
          font-weight: bold;
          color: #ff4757;
        }
        
        .market-price {
          font-size: 26rpx;
          color: #999;
          text-decoration: line-through;
          margin-left: 15rpx;
        }
      }
      
      .product-stats {
        display: flex;
        gap: 30rpx;
        
        .sales-count,
        .stock-count {
          font-size: 24rpx;
          color: #666;
        }
      }
    }
    
    .product-status {
      position: absolute;
      top: 30rpx;
      right: 30rpx;
      padding: 8rpx 16rpx;
      border-radius: 20rpx;
      font-size: 24rpx;
      
      &.status-on {
        background: #e8f5e8;
        color: #5cb85c;
      }
      
      &.status-off {
        background: #ffebee;
        color: #f44336;
      }

      &.status-soldout {
        background: #fff5e5;
        color: #ff9800;
      }

      &.status-pending {
        background: #fff9e6;
        color: #ff9800;
      }

      &.status-reject {
        background: #fdecea;
        color: #e53935;
      }
    }
  }
  
  .product-actions {
    display: flex;
    gap: 15rpx;
    margin-top: 25rpx;
    padding-top: 25rpx;
    border-top: 1rpx solid #f0f0f0;
    margin-left: 60rpx;
    
    .action-btn {
      flex: 1;
      padding: 18rpx 20rpx;
      border-radius: 12rpx;
      font-size: 26rpx;
      border: none;
      
      &.primary {
        background: #5cb85c;
        color: white;
      }
      
      &.secondary {
        background: #f8f9fa;
        color: #666;
        border: 1rpx solid #e9ecef;
      }
      
      &.danger {
        background: #ff4757;
        color: white;
      }

      &.full {
        flex: 1;
        text-align: center;
      }
      
      &::after {
        border: none;
      }
    }
  }
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100rpx 60rpx;
  text-align: center;
  
  .empty-icon {
    width: 200rpx;
    height: 200rpx;
    margin-bottom: 30rpx;
    opacity: 0.3;
  }
  
  .empty-text {
    font-size: 30rpx;
    color: #999;
    margin-bottom: 40rpx;
  }
  
  .add-product-btn {
    background: #5cb85c;
    color: white;
    border-radius: 25rpx;
    font-size: 28rpx;
    padding: 20rpx 40rpx;
    border: none;
    
    &::after {
      border: none;
    }
  }
}

/* 加载更多 */
.load-more {
  text-align: center;
  padding: 40rpx;
  
  text {
    font-size: 28rpx;
    color: #5cb85c;
    padding: 20rpx;
  }
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40rpx;
}

.modal-content {
  background: white;
  border-radius: 20rpx;
  width: 100%;
  max-width: 600rpx;
  max-height: 80vh;
  overflow: hidden;
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30rpx;
    border-bottom: 1rpx solid #f0f0f0;
    
    .modal-title {
      font-size: 32rpx;
      font-weight: bold;
      color: #333;
    }
    
    .modal-close {
      font-size: 48rpx;
      color: #999;
      line-height: 1;
      padding: 10rpx;
    }
  }
  
  .modal-body {
    padding: 30rpx;
    max-height: 60vh;
    overflow-y: auto;
    
    .product-preview {
      display: flex;
      align-items: center;
      padding: 20rpx;
      background: #f8f9fa;
      border-radius: 12rpx;
      margin-bottom: 30rpx;
      
      .preview-image {
        width: 80rpx;
        height: 80rpx;
        border-radius: 8rpx;
        margin-right: 20rpx;
      }
      
      .preview-name {
        font-size: 28rpx;
        color: #333;
        font-weight: 500;
      }
    }
    
    .form-group {
      margin-bottom: 30rpx;
      
      .form-label {
        display: block;
        font-size: 28rpx;
        font-weight: 600;
        color: #333;
        margin-bottom: 15rpx;
      }
      
      .form-input {
        width: 100%;
        padding: 25rpx 20rpx;
        border: 2rpx solid #e0e0e0;
        border-radius: 12rpx;
        font-size: 30rpx;
        background: #fafafa;
        
        &:focus {
          border-color: #5cb85c;
          background: white;
        }
        
        &.price-input,
        &.stock-input {
          text-align: right;
          font-weight: 500;
          color: #ff4757;
        }
      }
      
      /* SKU选择器样式 */
      .sku-selector {
        display: flex;
        flex-wrap: wrap;
        gap: 12rpx;
        
        .sku-item {
          padding: 16rpx 24rpx;
          border-radius: 12rpx;
          border: 2rpx solid #e0e0e0;
          background: #f8f9fa;
          display: flex;
          flex-direction: column;
          align-items: center;
          min-width: 140rpx;
          
          &.active {
            border-color: #5cb85c;
            background: #f0f9f4;
          }
          
          .sku-name {
            font-size: 26rpx;
            color: #333;
            font-weight: 500;
            margin-bottom: 8rpx;
          }
          
          .sku-price,
          .sku-stock {
            font-size: 24rpx;
            color: #999;
          }
        }
      }
    }
    
    .stock-tips {
      background: #fff3cd;
      padding: 20rpx;
      border-radius: 12rpx;
      margin-top: 20rpx;
      
      .tip-text {
        display: block;
        font-size: 24rpx;
        color: #856404;
        line-height: 1.5;
        margin-bottom: 5rpx;
        
        &:last-child {
          margin-bottom: 0;
        }
      }
    }
  }
  
  .modal-footer {
    display: flex;
    gap: 20rpx;
    padding: 30rpx;
    border-top: 1rpx solid #f0f0f0;
    
    .cancel-btn {
      flex: 1;
      padding: 25rpx;
      background: #f5f5f5;
      color: #666;
      border-radius: 12rpx;
      font-size: 30rpx;
      border: none;
      
      &::after {
        border: none;
      }
    }
    
    .confirm-btn {
      flex: 1;
      padding: 25rpx;
      background: #5cb85c;
      color: white;
      border-radius: 12rpx;
      font-size: 30rpx;
      border: none;
      
      &::after {
        border: none;
      }
      
      &:disabled {
        background: #ccc;
      }
      
      &.full {
        flex: none;
        width: 100%;
      }
    }
  }
}

/* 商品详情弹窗 */
.detail-modal {
  max-height: 80vh;
  
  .detail-body {
    max-height: 60vh;
    overflow-y: auto;
  }
  
  .detail-section {
    margin-bottom: 30rpx;
    
    &:last-child {
      margin-bottom: 0;
    }
    
    .detail-image {
      width: 100%;
      height: 400rpx;
      border-radius: 12rpx;
      margin-bottom: 20rpx;
    }
    
    .detail-info {
      .detail-name {
        display: block;
        font-size: 32rpx;
        font-weight: 600;
        color: #333;
        margin-bottom: 15rpx;
      }
      
      .detail-desc {
        display: block;
        font-size: 26rpx;
        color: #666;
        line-height: 1.6;
        margin-bottom: 20rpx;
      }
      
      .detail-price {
        display: flex;
        align-items: baseline;
        margin-bottom: 15rpx;
        
        .price-label {
          font-size: 26rpx;
          color: #666;
          margin-right: 10rpx;
        }
        
        .price-value {
          font-size: 36rpx;
          font-weight: 600;
          color: #ff4d4f;
        }
        
        .market-price {
          font-size: 24rpx;
          color: #999;
          text-decoration: line-through;
          margin-left: 15rpx;
        }
      }
      
      .detail-row {
        display: flex;
        align-items: center;
        padding: 15rpx 0;
        border-bottom: 1rpx solid #f0f0f0;
        
        &:last-child {
          border-bottom: none;
        }
        
        .row-label {
          font-size: 28rpx;
          color: #666;
          width: 150rpx;
        }
        
        .row-value {
          font-size: 28rpx;
          color: #333;
          flex: 1;
          
          &.status-1 {
            color: #52c41a;
          }
          
          &.status-0 {
            color: #999;
          }
          
          &.status-2 {
            color: #ff4d4f;
          }
          
          &.audit-1 {
            color: #52c41a;
          }
          
          &.audit-0 {
            color: #faad14;
          }
          
          &.audit-2 {
            color: #ff4d4f;
          }
        }
      }
    }
    
    .section-title {
      display: block;
      font-size: 30rpx;
      font-weight: 600;
      color: #333;
      margin-bottom: 20rpx;
      padding-bottom: 15rpx;
      border-bottom: 2rpx solid #f0f0f0;
    }
    
    .spec-list {
      .spec-item {
        display: flex;
        padding: 15rpx 0;
        
        .spec-name {
          font-size: 28rpx;
          color: #666;
          width: 150rpx;
          flex-shrink: 0;
        }
        
        .spec-options {
          font-size: 28rpx;
          color: #333;
          flex: 1;
        }
      }
    }
    
    .sku-list {
      .sku-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20rpx;
        background: #f8f9fa;
        border-radius: 12rpx;
        margin-bottom: 15rpx;
        
        &:last-child {
          margin-bottom: 0;
        }
        
        .sku-name {
          font-size: 28rpx;
          color: #333;
          flex: 1;
        }
        
        .sku-price {
          font-size: 30rpx;
          font-weight: 600;
          color: #ff4d4f;
          margin: 0 20rpx;
        }
        
        .sku-stock {
          font-size: 26rpx;
          color: #666;
        }
      }
    }
  }
}

